#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <iostream>
#include <QDebug>
#include <QFile>


QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    QFile file;
    // 编码名称到QStringConverter::Encoding的映射
    QMap<QString, QStringConverter::Encoding> encodingMap = {
        {"UTF-8", QStringConverter::Utf8},
        {"UTF-16", QStringConverter::Utf16},
        {"UTF-16 LE", QStringConverter::Utf16LE},
        {"UTF-16 BE", QStringConverter::Utf16BE},
        {"Latin1", QStringConverter::Latin1},
        {"System", QStringConverter::System}
    };

    Widget(QWidget *parent = nullptr);
    ~Widget();


signals:
    void mySignal();
    void mySignalWithParams(int value);

private slots:
    void mySlot();
    void mySlotWithParams(int value);

    void on_btnClose_clicked();
    void onBtnOpenClicked();
    void onBtnClearClicked();
    void onCurrentIndexChanged(int index);

    void onCursorPositionChanged();
private:
    Ui::Widget *ui;
};
#endif // WIDGET_H
